package com.heima.listener;

import org.apache.commons.lang3.StringUtils;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

@Component
public class HelloListener {

    @KafkaListener(topics = "itcast-topic",groupId = "1001")
    public void message(String msg){
        if (!StringUtils.isEmpty(msg)){
            System.out.println("消费者1");
            System.out.println(msg);
        }
    }


    @KafkaListener(topics = "itcast-topic",groupId = "1002")
    public void message2(String msg){
        System.out.println("消费者2");
        System.out.println(msg);
    }
}
